﻿using Kernelx.Contexts.Repositories.Core;
using System;
using System.Collections.Generic;
using System.Linq;



namespace Kernelx.Contexts.Defaults.RepositoriesWaylays
{
    internal class ModelStoreMaylay<T>: IModelStore<T> where T : class, new()
    {
        private IModelStore<T> _store;
        public ModelStoreMaylay(IModelStore<T> store) 
        {
            _store = store;
        }

        public T Find(params object[] ids)
        {
            return _store.Find(ids);
        }

        public void Insert(T ety)
        {
            _store.Insert(ety);
        }

        public void Insert(IList<T> etys)
        {
            _store.Insert(etys);
        }

        public void PhysicsDelete(T ety)
        {
            _store.PhysicsDelete(ety);
        }

        public void PhysicsDelete(IList<T> etys)
        {
            _store.PhysicsDelete(etys);
        }

        public IModelTrack<T> Update(T ety)
        {
            return _store.Update(ety);
        }


        public IQueryable<T> GetQuery(bool isTracking = false)
        {
            var query = _store.GetQuery(isTracking);
             //todo:设置拦截操作
            return query;
        }

         
    }
}
